<template>
    <div class="panel-body">
        <div>
            <h2>Home组件内容</h2>
            <div>
                <ul class="nav nav-tabs">
                    <li>
                    <router-link   class="list-group-item" active-class="active" to="/home/news">News</router-link>
                    </li>
                    <li>
                    <router-link  class="list-group-item" active-class="active" to="/home/message">Message</router-link>
                    </li>
                </ul>
            </div>
            <!-- 缓存一个路由， include:指定需要缓存的路由组件名称，注意是组件名称，组件名称，组件名称！！！！ -->
            <keep-alive include="News">
                <router-view></router-view>
            </keep-alive>

            <!-- 缓存多个路由,include 使用数组形式 ，指定需要缓存的组件名-->
            <!-- <keep-alive :include="['News','Message']">
                <router-view></router-view>
            </keep-alive> -->
        </div>
    </div>
</template>

<script>
    export default {
        name:'Home',
        mounted(){
            console.log('Home已挂载',this);
            window.HomeRoute = this.$route;
            window.HomeRouter = this.$router;
        },
    }
</script>

<style>

</style>